package com.ijiuchuang.jc_localization.contract.settings;

import android.content.Context;
import android.graphics.Bitmap;

import com.ijiuchuang.jc_localization.base.BasePresenter;
import com.ijiuchuang.jc_localization.base.BaseView;
import com.ijiuchuang.jc_localization.bean.lite.Map;
import com.ijiuchuang.jc_localization.bean.lite.Station;

import java.util.List;

import rx.Subscriber;
import rx.functions.Action1;

/**
 * Created by Veev on 2016/6/20
 *
 * @link 384506557@qq.com
 */
public interface SettsMapDetailContract {

    interface View extends BaseView<Presenter> {
        // do in here
        void setDatas(String[] datas);
        void setMap(Bitmap bitmap);
        void setSpinner(int position);

        void setName(String name);
        void setSubtitle(String title);
        void setSwitchChecked(boolean isChecked);
        void setDefaultLinearVisibility(boolean isVisiable);
        void setSize(String size);

        void showUpdateStation(Station station);

        void animationFull();
        void animationFullExit();

        String getName();
        int getSpinner();
        Map getMap();

        void addStations(Station ...stations);
        void setStationSpinner(List<String> stations);
    }

    interface Presenter extends BasePresenter {
        // do in here
        void getMapBitmap(int position);
        void getSelectStation(int position);
        void loadConfig(Map map);

        void saveMap(Map map, String name, int spinner);
        void setDefault(Map map);

        void getAnimation();

        int getTopHeight();
        void setTopHeight(int height);

        boolean inputVerify(String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        boolean updateVerify(Station station, String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        void saveStation(String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        void updateStation(Station station, String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
    }

    interface Model {
        // do in here
        void getMapsList(Context context, Action1<String[]> action1);
        void getMapBitmap(Context context, int position, Action1<Bitmap> action1);
        int loadPosition(String key);

        void saveMap(Context context, Map map, String name, int position);
        void setDefault(Map map);

        void getDefaultMap(Subscriber<Number> subscriber);

        int getAnimation();

        int getTopHeight();
        void setTopHeight(int height);

        // 验证输入信息是否准确
        boolean inputVerify(String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        // 保存基站
        Station saveStation(String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        Station updateStation(Station station, String num, String mac, String x, String y, String limit, String remark, boolean isShown, Map map);
        // 加载全部基站
        void loadStation(Map map, Subscriber<List<Station>> subscriber);
        // 根据spinner中的位置获取基站信息
        void getStation(Map map, int position, Subscriber<Station> subscriber);
    }
}
